<?php
session_start();
	require_once('../include/connect.inc.php');
	require_once('../include/layout-jquery.php');
if($_SESSION['sess_id'] <> session_id()){
?>
 <SCRIPT LANGUAGE="JavaScript">
	alert("กรุณาเข้าสู่ระบบให้ถูกต้องตามขั้นตอน...!");
		location="login.php";
</script>
<?php }?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Model Test Program</title>
<link rel="stylesheet" type="text/css" href="../template/template_style_wood.css">
<script>
	function actionFrom (str, id){
		//window.location.href='frm_make_set.php?set_id='+id+'&type_select='+str;
		$('#type_select').val(str);
		$('#frm').submit();
	}
	function actionFrom2(str, id){
		$('#type_select').val(str);
		//alert(str);
		//window.location.href='frm_make_set.php?set_id='+id+'&type_select=choose';
	}
</script>
</head>
<?php 
$set_id = (int)$_GET[set_id];
$sql = " SELECT
g.gen_id, g.level_q_id as d, g.num, g.num_match, g.type_id,
s.set_id, s.rangetest_id, s.subject_id, s.topic_id, s.start_dates, s.end_dates, s.set_sum_question, s.set_num_match, 
s.set_time_dotest, s.set_date_cre 
FROM tb_set_of_test s
INNER JOIN tb_gen_torand g ON s.set_id=g.set_id  
WHERE s.topic_id=g.topic_id AND s.rangetest_id=g.rangetest_id AND s.set_id='".$set_id."'";
$query = query( $sql );
		while ($rs = fetch_array($query)){
				$set_sum_question 	= $rs['set_sum_question'];
				$set_num_match		= $rs['set_num_match'];
				$set_time_dotest  	= $rs['set_time_dotest'];
				$set_point		  		= $rs['set_sum_question'];
				$rangetest 		  		= $rs['rangetest_id'];
				$rangetest_detail 		= $rs['rangetest_detail'];
				$subject		 			= $rs['subject_id'];
				$topic			  			= $rs['topic_id'];
				$type_id		  			= $rs['type_id'];
				$gen_id			  		= $rs['gen_id'];
				if( $type_id == 1 ){
					$set_one_question   = $set_one_question+$rs['num'];
				} 
				else if( $type_id == 2 ){
					$set_multi_question = $set_multi_question+$rs['num'];
				} 
				else if( $type_id == 3 ){
					$set_tf_question   = $set_tf_question+$rs['num'];
				}
				else if( $type_id == 4 ){
					$set_word_question = $set_word_question+$rs['num'];
				} 
				else if( $type_id == 5 ){
					$set_match_question = $set_match_question+$rs['num_match'];
				}
		}				
?>
<body>
<div id="menu"><div><img src="../images/icon-m.png" /></div>
<div id="menulinks">
		<a  href="../person_tea.php">ข้อมูลส่วนตัว</a>
		<a href="../tea_edit.php">เปลี่ยนรหัสผ่านใหม่</a>
        <a href="show_subject.php">จัดการรายวิชา</a>
		<a  href="../teacher_test.php">จัดการข้อสอบ</a>
        <a class="active" href="../teacher_tests.php">จัดการชุดข้อสอบ</a>
        <a  href="../agree_set.php">กำหนดสิทธิ์</a>
		<a href="../exam/tea_chack.php">ตรวจสอบคะแนน</a>
        <a href="../news/manage_news.php">ประกาศข่าวสาร</a>
        <a href="../problem/send_problem.php">แสดงความคิดเห็น</a>
        <a href="../logout.php">ออกจากระบบ</a>
		</div></div>           
 <div id="p3">    
<div id="header"></div>
   <div id="page"><div id="p1">คุณ<?php echo $_SESSION['teacher_name'];?><hr/>
    
<form id="frm" name="frm" method="post" action="frm_make_set.php?set_id=<?php echo $set_id;?>">
<input type="hidden" name="type_select" id="type_select"></input>
<?php $query = query("SELECT * FROM tb_set_of_test se   
		INNER JOIN  tb_rangetest ra ON  ra.rangetest_id = se.rangetest_id 
		INNER JOIN  tb_subject su ON  su.subject_id = se.subject_id 
		INNER JOIN  tb_topic tp ON  tp.topic_id = se.topic_id WHERE se.set_id='$set_id'");
			while ($rs = fetch_array($query)) {
				$set_id 	  	  		= $rs['set_id'];
				$set_date_cre 	  	= $rs['set_date_cre'];
				$subject_name     = $rs['subject_name'];
				$topic_detail     	= $rs ['topic_detail'];   
				$rangetest_detail = $rs ['rangetest_detail'];
				?>
รายการจัดการสอบ <a href="frm_show_set.php"><img src="../images/undo.png" border="0" /></a>
<table border="0"  id="table-t">
    <tr>
       <td width="31%" align="right">ข้อสอบวิชา :</td>
        <td width="69%" align="left"><?php echo $subject_name; ?></td>
    </tr>
    <tr>
      <td align="right">หัวข้อ :</td>
    	 <td align="left"><?php echo $topic_detail;?></td>
      </tr>
      <tr>
      <td align="right">ช่วงสอบ :</td>
      <td><?php echo $rangetest_detail; ?></td>
    </tr>
	<tr>
      <td align="right">เวลา :</td>
      <td align="left"><?php echo $set_time_dotest;?> นาที</td>
    </tr>
    <tr>
    		 <td colspan="2"><font size="+2"><u><strong>ประเภทข้อสอบ</strong></u></font></td>
  		  </tr>
    <tr>
      <td>1.เลือกตอบได้ตัวเลือกเดียว</td>
      <td>จำนวน : <?php echo $set_one_question;?> ข้อ</td>
    </tr>
    <tr>
      <td>2.เลือกตอบได้หลายตัวเลือก</td>
      <td>จำนวน : <? echo $set_multi_question;?> ข้อ </td>
    </tr>
    <tr>
      <td>3.ข้อสอบถูก-ผิด</td>
      <td>จำนวน : <?php echo $set_tf_question;?> ข้อ</td>
    </tr>
    <?php /*?><tr>
      <td>4.ข้อสอบจับเติมคำ</td>
      <td>จำนวน : <?php echo $set_word_question;?> ข้อ </td>
    </tr><?php */?>
    <tr>
      <td>4.ข้อสอบจับคู่ </td>
      <td>จำนวน : <?php echo $set_match_question;?> ชุด </td>
    </tr>
    <tr>
      <td colspan="2">
      <label>
      	  <input type="button" name="random" id="random" value="สุ่มข้อสอบ"   onclick="actionFrom('random', <?php echo $set_id;?>)" />
      </label></td>
    </tr>
    <?php } ?>
  </table>
</form>

<?php 
if($_POST['type_select'] == 'random'){ 
	$set_id = (int)$_GET['set_id'];
?>
<form id="form3" name="form3" method="post" action="frm_make_set.php?action=add">
<?php
$sql = " SELECT
tb_gen_torand.gen_id,
tb_gen_torand.level_q_id as d,
tb_gen_torand.num,
tb_set_of_test.set_id,
tb_set_of_test.rangetest_id,
tb_set_of_test.subject_id,
tb_set_of_test.topic_id,
tb_set_of_test.start_dates,
tb_set_of_test.end_dates,
tb_set_of_test.set_sum_question,
tb_set_of_test.set_num_match,
tb_set_of_test.set_time_dotest,
tb_set_of_test.set_date_cre,
tb_gen_torand.type_id
FROM
tb_set_of_test
Inner Join tb_gen_torand ON tb_set_of_test.set_id=tb_gen_torand.set_id  where tb_set_of_test.topic_id=tb_gen_torand.topic_id and  tb_set_of_test.rangetest_id=tb_gen_torand.rangetest_id and tb_set_of_test.set_id='".$set_id."' order by tb_gen_torand.type_id ASC"; 
$query1 = query( $sql );
		while ($rs1 = fetch_array($query1)){
				$gen_id		= $rs1['gen_id'];
				$topic			= $rs1['topic_id'];
				$DIFFICUS	= $rs1['d'];
			 	$nums			= $rs1['num']; //จำนวนประเภทคำถาม
 			    $type_id		= $rs1['type_id'];  //ประเภทข้อสอบ
				$set_match	=$rs1['set_num_match'];
				$set_id			=$rs1['set_id'];
?>

<?php
//--------เงื่อนไขเพิ่มข้อ
if($nums!=0){
$count=1;
$sql2 = "SELECT * FROM tb_question where topic_id=$topic and type_id=$type_id and level_q_id=$DIFFICUS order by type_id ASC LIMIT 0,$nums";
	$query2 = query( $sql2 );
		while ($rs2 = fetch_array($query2)){
			$pic_name=$rs2['pic_name'];
			$media_name=$rs2['media_name'];
			$type_id=$rs2['type_id'];
			$level_q_id=$rs2['level_q_id'];
			?>
<table border="0" cellpadding="0" cellspacing="0"  id="table-m" >
	<tr>
		<td width="63%">
 		<div>
        <input type="hidden" name="question_id[]" id="question_id[]" value="<? echo $rs2[question_id]?>" />                  
        <input type="hidden" name="set" id="set" value="<?php echo $rs1['set_id']?>" />
		<?php echo $rs2['question_detail']; ?>--->
		ระดับ:<?php 
		$query30=query("SELECT * FROM tb_level_question where level_q_id='$level_q_id' ");
			while ($rs30=fetch_array($query30)){
				echo $level_q_detail=$rs30['level_q_detail'];
			}
		?>
		</div>
<?php
$query3 = query("SELECT * FROM tb_choice  where question_id=' " .$rs2['question_id']." ' ");
	while ($rs3 = fetch_array($query3)){
		$rs3['answer'];
?>
	<div class="p21"><?  if($rs2['type_id']==2){?>
	<label>
		<input type="checkbox" name="choice[]<?=$count?>"  value="<? echo $rs3[choice_id];?>"  <? if  ($rs3['answer']==1){?> checked="checked" <? }?> disabled="disabled">
	</label>
	<? }else{ ?>
	<label>
		<input type="radio" name="choice[]<?=$count?>"  value="<? echo $rs3[choice_id];?>"  <? if  ($rs3['answer']==1){?> checked="checked" <? }?> disabled="disabled">
	</label>
	 <? } ?>
		<?  echo $rs3['choice_detail'];?> 
	</div>
	 <?  $count++;}?>
<th width="37%" align="right">
<? //---------------แสดงรูปหากเป็นข้อสอบประเภทรูปภาพ?>
<?  if($rs2['pic_name']!=""){?>
	<div align="center"><a href="../upload/<? echo  $rs2['pic_name'];?>" target="_blank">
		<img src="../upload/<? echo  $rs2['pic_name'];?>" border="0" width=50 height=50 
		onclick="window.open('../upload/<? echo  $rs2['pic_name'];?>','mywindow','width=500,height=500')" /></a>
	<div>
    	<small>คลิ๊กที่รูปเพื่อดูขนาดใหญ่</small>
	</div>
	</div>
<? }?>
<? //---------------แสดงรูปหากเป็นข้อสอบประเภทเสียง------------------?>
<?  if($rs2['media_name']!=""){?>
<table align="right">
	<tr>
		<th>
        	<object id="mediaPlayer" height="23" width="219" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95">
            	<param name="fileName" value='<? echo "../upload/".$rs2['media_name']; ?>' valuetype='ref' />
                <param name="AutoStart" value="0" />
				<param name="TransparentAtStart" value="true" />
				<param name="SendPlayStateChangeEvents" value="true" />
				<param name="ShowControls" value="0" />
				<param name="ShowDisplay" value="0" />
				<param name="ShowStatusBar" value="1" />
				<param name="ShowGotoBar" value="0" />
				<param name="ShowPositionControls" value="0" />
				<param name="AutoSize" value="0" />
				<param name="volume" value="0" />
				<param name="loop" value="0" />
			</object>
		</th>
	</tr>
	<tr>
		<th align="left">
        	<img style="CURSOR: pointer" 
				onclick="mediaPlayer.play()" height="30" 
				src="../soundbox/play-48x48.png" 
				width="30" /><img style="CURSOR: pointer" 
				onclick="mediaPlayer.pause()" height="30" 
				src="../soundbox/puse-48x48.png" 
				width="30" /><img 
                src="../soundbox/stop-48x48.png" 
				width="30" height="30" style="CURSOR: pointer" 
				onclick="mediaPlayer.stop()" />
			</th>
	</tr>
</table>
<?php }?>
		</th>
	</tr>
</table>       
<?php $count++; } }?>
<?php }?>

<?php 
if ($set_match!=0){
$query= query("SELECT DISTINCT match_set FROM tb_question where topic_id='$topic' AND type_id='$type_id' AND level_q_id='$DIFFICUS' order by RAND()");
	while ($rs= fetch_array($query)) {
		$match_set=$rs['match_set'];
		}
		if($match_set==0){
				$match_set=$match_set+1;
				}
?>
ข้อสอบจับคู่! *ชุดที่<?php echo "$match_set";?>
<input type="hidden" name="set" id="set" value="<?php echo $_GET['set_id']?>" />
<table border="0" cellpadding="0" cellspacing="0"  id="table-m" >
	<tr>
      <td width="187"><font size="+2"><strong>คำถาม</strong></font></td>
      <td width="198"><font size="+2"><strong>คำตอบ</strong></font></td>
      <td width="198"><font size="+2"><strong>ข้อลวง</strong></font></td>
    </tr>
<?php 
$num=0;
$queryQ= query("SELECT * FROM tb_question where match_set=$match_set order by RAND()");
		while ($rs = fetch_array($queryQ)) {
			$question_id=$rs['question_id'];
			$question_detail=$rs['question_detail'];
			$num++;
?>
    <tr>
		<td>ข้อที่<?php echo $num?>) <?php echo "$question_detail";?></td>
      	<td>
<?php 
	$queryC= query("SELECT * FROM tb_choice where match_set=$match_set and question_id=$question_id and answer!=0");
	//$queryC= query("SELECT * FROM tb_choice where match_set=$match_set order by RAND()");
		while ($rs = fetch_array($queryC)) {
			$choice_id=$rs['choice_id'];
			$choice_detail=$rs['choice_detail'];
?>
			คำตอบข้อที่ <?php echo $num?>) <?php echo "$choice_detail";?>
<?php }?>
       </td>
       <td>
<?php }?>
<table border="0">
	<tr>
		<td>
<?php
$numlie=0;
	$querylie= query("SELECT * FROM tb_choice where match_set=$match_set and answer=0");
		while ($rs = fetch_array($querylie)){
			$choice_id=$rs['choice_id'];
			$choice_detail=$rs['choice_detail'];
			$numlie++;
			?>
           ข้อลวงที่ <?php echo $numlie?>) <?php echo "$choice_detail";?>
		</td>
        <?php }?>
	</tr>
</table>
       </td>
    </tr>
</table>
<input type="hidden" name="set_cho" id="set_cho" value="<?php echo $match_set?>"/>
<?php }?>
<input type="submit" name="btnsave" id="btnsave" value="บันทึก" />
</form>

<?php //--------------------------------ถ้ากดเลือก------------------------------------?>
<?php }else if( $_POST['type_select'] == "choose" ){ ?>
<form id="form4" name="form4" method="post" action="frm_make_set.php?action=add">
<?php 
$query1 = query(" SELECT
tb_gen_torand.gen_id,
tb_gen_torand.level_q_id,
tb_gen_torand.num,
tb_set_of_test.set_id,
tb_set_of_test.rangetest_id,
tb_set_of_test.subject_id,
tb_set_of_test.topic_id,
tb_set_of_test.start_dates,
tb_set_of_test.end_dates,
tb_set_of_test.set_sum_question,
tb_set_of_test.set_time_dotest,
tb_set_of_test.set_date_cre,
tb_gen_torand.type_id
FROM
tb_set_of_test
Inner Join tb_gen_torand ON tb_set_of_test.set_id=tb_gen_torand.set_id  where tb_set_of_test.topic_id=tb_gen_torand.topic_id and  tb_set_of_test.rangetest_id=tb_gen_torand.rangetest_id and tb_set_of_test.set_id='".$_GET[set_id]."'");
		while ($rs1 = fetch_array($query1)){
				$gen_id			=$rs1['gen_id'];
				$topic				=$rs1['topic_id'];
				$DIFFICUS     =$rs1['level_q_id'];
			 	$nums              = $rs1['num']; //จำนวนประเภทคำถาม
 			    $type_id           =$rs1['type_id']; //ประเภทข้อสอบ
				
//--------เงื่อนไขเพิ่มข้อ
$query2 = query("SELECT * FROM tb_question where topic_id=$topic and type_id=$type_id and level_q_id=$DIFFICUS");
	while ($rs2 = fetch_array($query2)){
		?>
<table border="0" cellpadding="0" cellspacing="0"  id="table-m" >
	<tr>
		<td width="63%">
		<div>
		<input type="hidden" name="question_id[]" id="question_id[]" value="<?php echo $rs2[question_id]?>" />
		<input type="hidden" name="set" id="set" value="<?php echo $rs1[set_id]?>"/>
		<input type="checkbox" name="choose2" id="choose2"  value="<?php echo $rs2[question_id ]?>" />
		: เลือกข้อนี้<?php echo "<br>"?>
		<?php echo $rs2['question_detail']; ?></div>
<?php
$query35 = query("SELECT * FROM tb_choice  where question_id=' " .$rs2['question_id']." ' ");
	while ($rs35 = fetch_array($query35)){
	?>
	<div class="p21"><?  if($rs2['type_id']==2){?>
	<label>
	<input type="checkbox" name="choice[]"  value="<? echo $rs35[choice_id];?>"  <? if  ($rs35['answer']==1){?> checked="checked" <? }?> disabled="disabled">
	</label>
		<? }else{ ?>
	<label>
	<input type="radio" name="choice[]"  value="<? echo $rs3[choice_id];?>"  <? if  ($rs3['answer']==1){?> checked="checked" <? }?> disabled="disabled">
	</label>
	<? } ?>
	<?  echo $rs3['choice_detail'];?> 
	</div>
	<?php }?>
	<th width="37%" align="right">
<? //---------------แสดงรูปหากเป็นข้อสอบประเภทรูปภาพ?>
<?  if($rs2['pic_name']!=""){?>
	<div align="center"><a href="../upload/<? echo  $rs2['pic_name'];?>" target="_blank">
		<img src="../upload/<? echo  $rs2['pic_name'];?>" border="0" width=50 height=50 
		onclick="window.open('../upload/<? echo  $rs2['pic_name'];?>','mywindow','width=500,height=500')" /></a>
		<div><small>คลิ๊กที่รูปเพื่อดูขนาดใหญ่</small></div>
</div>
<? }?>
<? //---------------แสดงรูปหากเป็นข้อสอบประเภทเสียง------------------?>
<?  if($rs2['media_name']!=""){?>
<table align="right">
	<tr>
		<th>
        	<object id="mediaPlayer" height="23" width="219" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95">
				<param name="fileName" value='<? echo "../upload/".$rs2['media_name']; ?>' valuetype='ref' />
				<param name="AutoStart" value="1" />
				<param name="TransparentAtStart" value="true" />
                <param name="SendPlayStateChangeEvents" value="true" />
                <param name="ShowControls" value="0" />
                <param name="ShowDisplay" value="0" />
                <param name="ShowStatusBar" value="1" />
                <param name="ShowGotoBar" value="0" />
                <param name="ShowPositionControls" value="0" />
                <param name="AutoSize" value="0" />
                <param name="volume" value="0" />
                <param name="loop" value="0" />
			</object>
		</th>
	</tr>
	<tr>
		<th align="left">
			<img style="CURSOR: pointer" 
				onclick="mediaPlayer.play()" height="30" 
				src="../soundbox/play-48x48.png" 
				width="30" /><img style="CURSOR: pointer" 
				onclick="mediaPlayer.pause()" height="30" 
				src="../soundbox/puse-48x48.png" 
				width="30" /><img 
				src="../soundbox/stop-48x48.png" 
				width="30" height="30" style="CURSOR: pointer" 
				onclick="mediaPlayer.stop()" />
		</th>
	</tr>
</table>
<? }?>
		</th>
	</tr>
</table>       
<?  }// }?>
<? }?>
<input type="submit" name="btnsave" id="btnsave" value="บันทึก" />
</form>
<? }?>

<?php
	if($_GET[action] == 'add' ){
/*?>$query1= query("SELECT  * FROM tb_gen_torand  where set_id='".$_GET[set_id]."' and  type_id=1");
	$rs1= fetch_array($query1);
		$num1=$rs1['num'];
$query2= query("SELECT  * FROM tb_gen_torand  where set_id='".$_GET[set_id]."' and  type_id=2");
	$rs2= fetch_array($query2);
		$num2=$rs2['num'];
$query3= query("SELECT  * FROM tb_gen_torand  where set_id='".$_GET[set_id]."' and  type_id=3");
	$rs3= fetch_array($query3);
		$num3=$rs3['num'];
$query4= query("SELECT  * FROM tb_gen_torand  where set_id='".$_GET[set_id]."' and  type_id=4");
	$rs4= fetch_array($query4);
		$num4=$rs4['num'];
$query5= query("SELECT  * FROM tb_gen_torand  where set_id='".$_GET[set_id]."' and  type_id=5");
	$rs5= fetch_array($query5);
		$num5=$rs5['num'];
$query6= query("SELECT  * FROM tb_gen_torand  where set_id='".$_GET[set_id]."' and  type_id=6");
	$rs6= fetch_array($query6);
		$num6=$rs6['num'];
$query7= query("SELECT  * FROM tb_gen_torand  where set_id='".$_GET[set_id]."' and  type_id=7");
	$rs7= fetch_array($query7);
		echo $num7=$rs7['num'];
				
			$t1=0;
			$t2=0;
			$t3=0;
			$t4=0;
			$t5=0;
			$t6=0;
			$t7=0;
			for ($i=0;$i<count($_POST[choose]);$i++){
						$query= query("SELECT  * FROM tb_question  where question_id='".$choose[$i]."' ");
							$rs= fetch_array($query);
						//echo $type_id=$rs['type_id'];
						if($rs['type_id']==1){
								$t1+=1;
						}
						if($rs['type_id']==2){
								$t2+=1;
						}
						if($rs['type_id']==3){
								$t3+=1;
						}
						if($rs['type_id']==4){
								$t4+=1;
						}
						if($rs['type_id']==5){
								$t5+=1;
						}
						if($rs['type_id']==6){
								$t6+=1;
								
						}
						if($rs['type_id']==7){
								$t7+=1;
						}
						if($num1>0 && $t1>0 && $num1==$t1){
						}elseif($num2>0 && $t2>0 && $num2==$t2){
						}elseif($num3>0 && $t3>0 && $num3==$t3){
						}elseif($num4>0 && $t4>0 && $num4==$t4){
						}elseif($num5>0 && $t5>0 && $num5==$t5){
						}elseif($num6>0 && $t6>0 && $num6==$t6){
						/*}elseif($num7>0 && $t7>0 && $num7==$t7){*/
						/*}else{
									echo "ข้อที่เลือกไม่ตรงตามจำนวนที่ได้เลือกไว้";
									exit();
						}*/
						//echo $t6;
						//echo $choose[$i];<?php */

//------------เพิ่มข้อสอบลงในการจัดชุด----------1234

//foreach( $_POST['question_id'] as $key => $val ){
for ($i=0;$i<count($question_id);$i++){
$question_id[$i];
$set=$_POST['set'];
	$strSql="INSERT INTO tb_set_detail (set_id,question_id) VALUES ('".$set."','".$question_id[$i]."')";
		execute($strSql);
}

//-----------เพิ่มข้อสอบจับคู่ลงในการจัดชุด-------5 ... ตาม set_cho(set_choose)
$set_cho=$_POST['set_cho'];
$set=$_POST['set'];
if($set_cho!=""){
	$strSql="INSERT INTO tb_set_detail (set_id,match_set_cho) VALUES ('".$set."','".$set_cho."')";
		execute($strSql);
}			
		 		$ProcessOutput .= "<BR><BR>";
				$ProcessOutput .= "<LEFT><BR>";
				$ProcessOutput .= "<FONT COLOR=\"#336600\"><B>เพิ่มข้อมูลเรียบร้อยแล้ว</B></FONT><BR><BR>";
				$ProcessOutput .= "<A HREF=\"frm_show_set.php\"><B>กลับหน้าแสดงชุดข้อสอบ</B></A>";
				$ProcessOutput .= "</LEFT>";
				$ProcessOutput .= "<BR><BR>";
				echo $ProcessOutput ;
}
 ?>
    </div>
    </div>
<div id="footer"></div>
</div>
</body>
</html>